package MapEditor;

import java.util.ArrayList;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.doge.Textures;
import com.doge.Tile;

class GridSquare extends Actor
{
	public Tile t;
	public boolean isSelected = false;
	//public boolean displayGrid = false;
	public ArrayList<Integer> textureIds = new ArrayList<Integer>();
	
	public GridSquare(Tile t)//, boolean displayGrid)
	{
		this.t = t;
		//this.displayGrid = displayGrid;
	}
	
	public void addTexture(TextureRegion region, int id)
	{
		this.t.addTexture(region);
		this.textureIds.add(id);
	}
	
	public void draw (SpriteBatch batch, float parentAlpha) 
	{
		t.draw(batch,parentAlpha);
		
		Color color = getColor();
	    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
	    
		if(isSelected)
			batch.draw(Textures.selectedTile, t.pixx, t.pixy, 32, 32);
		//if(displayGrid)
		//	batch.draw(Textures.gridSquareOutline, t.pixx, t.pixy, 32, 32);
		
	    super.draw(batch, parentAlpha);
	}
}